<!DOCTYPE html>
<html>
<head>
	<title>观点</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
	<link rel="stylesheet" type="text/css" href="css/styles.css">
	<link rel="stylesheet" type="text/css" href="css/liCai.css">

	<link rel="stylesheet" type="text/css" href="css/scrollbar.css">
	<script type="application/javascript" src="js/iscroll.js"></script>
	<script type="text/javascript" src="js/jquery.min.js"></script>


	<style type="text/css" media="all">

#header {
	position:absolute;
	top:0; left:0;
	width:100%;
	height:45px;
	line-height:45px;
	background-image:-webkit-gradient(linear, 0 0, 0 100%, color-stop(0, #fe96c9), color-stop(0.05, #d51875), color-stop(1, #7b0a2e));
	background-image:-moz-linear-gradient(top, #fe96c9, #d51875 5%, #7b0a2e);
	background-image:-o-linear-gradient(top, #fe96c9, #d51875 5%, #7b0a2e);
	padding:0;
	color:#eee;
	font-size:20px;
	text-align:center;
}

#header a {
	color:#f3f3f3;
	text-decoration:none;
	font-weight:bold;
	text-shadow:0 -1px 0 rgba(0,0,0,0.5);
}

#footer {
	position:absolute;
	bottom:0; left:0;
	width:100%;
	height:48px;
	background-image:-webkit-gradient(linear, 0 0, 0 100%, color-stop(0, #999), color-stop(0.02, #666), color-stop(1, #222));
	background-image:-moz-linear-gradient(top, #999, #666 2%, #222);
	background-image:-o-linear-gradient(top, #999, #666 2%, #222);
	padding:0;
	border-top:1px solid #444;
}

#wrapper {
	position:absolute; z-index:1;
	top:12rem; bottom:4.5rem; left:0;
	width:100%;
}

#scroller {
	position:relative;
/*	-webkit-touch-callout:none;*/
	-webkit-tap-highlight-color:rgba(0,0,0,0);

	float:left;
	width:100%;
	padding:0;
}

#scroller ul {
	position:relative;
	list-style:none;
	padding:0;
	margin:0;
	width:100%;
	text-align:left;
}

#scroller li {
	padding:0 10px;
	height:40px;
	line-height:40px;
	border-bottom:1px solid #ccc;
	border-top:1px solid #fff;
	background-color:#fafafa;
	font-size:14px;
}

#scroller li > a {
	display:block;
}

/**
 *
 * 下拉样式 Pull down styles
 *
 */
#pullDown, #pullUp {
	background:#fff;
	height:40px;
	line-height:40px;
	padding:5px 10px;
	font-weight:bold;
	font-size:14px;
	color:#888;
	width: 15rem;
	margin:0 auto;
}
#pullDown .pullDownIcon, #pullUp .pullUpIcon  {
	display:block; float:left;
	width:40px; height:40px;
	background:url(images/pull-icon@2x.png) 0 0 no-repeat;
	-webkit-background-size:40px 80px; background-size:40px 80px;
	-webkit-transition-property:-webkit-transform;
	-webkit-transition-duration:250ms;	
}
#pullDown .pullDownIcon {
	-webkit-transform:rotate(0deg) translateZ(0);
}
#pullUp .pullUpIcon  {
	-webkit-transform:rotate(-180deg) translateZ(0);
}

#pullDown.flip .pullDownIcon {
	-webkit-transform:rotate(-180deg) translateZ(0);
}

#pullUp.flip .pullUpIcon {
	-webkit-transform:rotate(0deg) translateZ(0);
}

#pullDown.loadingUp .pullDownIcon, #pullUp.loadingUp .pullUpIcon {
	background-position:0 100%;
	-webkit-transform:rotate(0deg) translateZ(0);
	-webkit-transition-duration:2s;
	-webkit-animation-name:loading;
	-webkit-animation-duration:2s;
	-webkit-animation-iteration-count:infinite;
	-webkit-animation-timing-function:linear;
}
.flip .up2rem, .loading .up2rem{
	margin-top: -2rem;
	display: block;
	padding-left: 4rem;
}
#pullDown.loading .pullDownIcon, #pullUp.loading .pullUpIcon {
	background-position:0 100%;
	-webkit-transform:rotate(0deg) translateZ(0);
	-webkit-transition-duration:2s;
	margin-top: -2rem;
	-webkit-animation-name:loading;
	-webkit-animation-duration:2s;
	-webkit-animation-iteration-count:infinite;
	-webkit-animation-timing-function:linear;
}

@-webkit-keyframes loading {
	from { -webkit-transform:rotate(0deg) translateZ(0); }
	to { -webkit-transform:rotate(360deg) translateZ(0); }
}

</style>

</head>
<body>
	<!--头部-->
	<header>
		<div class="top">
			<a href="#" target="_self"><img src="images/newicon9.png" style="height: 30px;" class="return" alt=""></a>
			<h2 class="titleh2">观点</h2>
			<div class="ziXun">
				<ul>
					<li class="liCai-activ"><a href="opinion.html">观点</a></li>
					<li><a href="money.html">理财</a></li>
					<li><a href="talk.html">杂谈</a></li>
				</ul>
			</div>
		</div>	
	</header>
	<div class="headerNext"></div>
	<!--搜索-->
	<article>
		<div class="search">
			<form  method="post" name="form1">
				<input type="text" name="search" value="" />
			</form>
		</div>
	</article>
	<!--资讯内容-->
	<article>
<div id="wrapper">
		<div class="content">
		<div id="pullDown">
				<span class="pullDownIcon"></span><span class="pullDownLabel">加载中...</span>
			</div>
			<ul id="thelist">
				<li>
					<a href="#">
						<img src="images/pic1.png" alt="" />
						<h2>新手入门购买基金的几种方式</h2>
						<p>初入市的同学，面对各种基金财的大数据及小道消息的轰炸，多半是...</p>
						<span>2016-8-22</span>
					</a>
					<div class="line"></div>
				</li>
				

				<li id="aaa">
					<a href="#">
						<img src="images/pic2.png" alt="" />
						<h2>QFll一季度布局路线图大曝光</h2>
						<p>初入市的同学，面对各金的理财的大数据及小道消息的轰炸，多半是...</p>
						<span>2016-8-22</span>
					</a>
					<div class="line"></div>
				</li>
				

				<li>
					<a href="#">
						<img src="images/pic3.png" alt="" />
						<h2>更加快捷购买基金的几种方式</h2>
						<p>初入市的同学，面对各种的理财的大数据及小道消息的轰炸，多半是...</p>
						<span>2016-8-22</span>
					</a>
					<div class="line"></div>
				</li>
				


				<li>
					<a href="#">
						<img src="images/pic2.png" alt="" />
						<h2>QFll一季度布局路线图大曝光</h2>
						<p>初入市的同学，面对各种基金的理财数据及小道消息的轰炸，多半是...</p>
						<span>2016-8-22</span>
					</a>
					<div class="line"></div>
				</li>
				

				<li>
					<a href="#">
						<img src="images/pic1.png" alt="" />
						<h2>新手入门购买基金的几种方式</h2>
						<p>初入市的同学，面对各种基金的理财的大及小道消息的轰炸，多半是...</p>
						<span>2016-8-22</span>
					</a>
					<div class="line"></div>
				</li>
				
				
			</ul>

			<div id="pullUp">
				<span class="pullUpIcon up2rem"></span><span class="pullUpLabel up2rem">加载中...</span>
			</div>
		</div>
	</div>	
	</article>

	<div class="footer"></div>
	<footer>
		<a href="#1">
			<div>
				<li class="home"></li>
				<li>首页</li>
			</div>
		</a>

		<a href="#2">
			<div>
				<li class="money"></li>
				<li>基金</li>
			</div>
		</a>

		<a href="#3">
			<div>
				<li class="me"></li>
				<li>我的</li>
			</div>
		</a>

		<a href="#3" >
			<div>
				<li class="zx"></li>
				<li class="red">资讯</li>
			</div>
		</a>


	</footer>


</body>

<script type="text/javascript">

var myScroll,
	pullDownEl, pullDownOffset,
	pullUpEl, pullUpOffset,
	generatedCount = 0;

/**
 * 下拉刷新 （自定义实现此方法）
 * myScroll.refresh();		// 数据加载完成后，调用界面更新方法
 */
function pullDownAction () {
	setTimeout(function () {	// <-- Simulate network congestion, remove setTimeout from production!
                var el, li, i;
                el = $("#thelist");

                for (i=0; i<3; i++) {
                    li = '<li> <a href="#"> <img src="images/pic1.png" alt=""> <h2>刷新的新内容' + (++generatedCount) + '</h2> <p>初入市的同学，面对各种基金财的大数据及小道消息的轰炸，多半是...</p> <span>2016-8-22</span> </a> <div class="line" style="margin-top:4rem;"></div> </li>';

                    el.prepend(li);
                }
           

		
		myScroll.refresh();		//数据加载完成后，调用界面更新方法   Remember to refresh when contents are loaded (ie: on ajax completion)
	}, 1000);	// <-- Simulate network congestion, remove setTimeout from production!
}

/**
 * 滚动翻页 （自定义实现此方法）
 * myScroll.refresh();		// 数据加载完成后，调用界面更新方法
 */
function pullUpAction () {
	setTimeout(function () {	// <-- Simulate network congestion, remove setTimeout from production!
                var el, li, i;
                el = $("#thelist");

                for (i=0; i<3; i++) {
                    li = '<li> <a href="#"> <img src="images/pic1.png" alt=""> <h2>刷新的新内容' + (++generatedCount) + '</h2> <p>初入市的同学，面对各种基金财的大数据及小道消息的轰炸，多半是...</p> <span>2016-8-22</span> </a> <div class="line" style="margin-top:4rem;"></div> </li>';

                    el.append(li);
                }
		
		myScroll.refresh();		// 数据加载完成后，调用界面更新方法 Remember to refresh when contents are loaded (ie: on ajax completion)
	}, 1000);	// <-- Simulate network congestion, remove setTimeout from production!
}

/**
 * 初始化iScroll控件
 */
function loaded() {
	pullDownEl = document.getElementById('pullDown');
	pullDownOffset = pullDownEl.offsetHeight;
	pullUpEl = document.getElementById('pullUp');	
	pullUpOffset = pullUpEl.offsetHeight;
	
	myScroll = new iScroll('wrapper', {
		scrollbarClass: 'myScrollbar', /* 重要样式 */
		useTransition: false,
		topOffset: pullDownOffset,
		onRefresh: function () {
			if (pullDownEl.className.match('loadingUp')) {
				pullDownEl.className = '';
				//pullDownEl.querySelector('.pullDownLabel').innerHTML = '下拉刷新...';
			} else if (pullUpEl.className.match('loading')) {
				pullUpEl.className = '';
				//pullUpEl.querySelector('.pullUpLabel').innerHTML = '上拉加载更多...';
			}
		},
		onScrollMove: function () {
			if (this.y > 5 && !pullDownEl.className.match('flip')) {
				pullDownEl.className = 'flip';
				//pullDownEl.querySelector('.pullDownLabel').innerHTML = '松手开始更新...';
				this.minScrollY = 0;
			} else if (this.y < 5 && pullDownEl.className.match('flip')) {
				pullDownEl.className = '';
				//pullDownEl.querySelector('.pullDownLabel').innerHTML = '下拉刷新...';
				this.minScrollY = -pullDownOffset;
			} else if (this.y < (this.maxScrollY - 5) && !pullUpEl.className.match('flip')) {
				pullUpEl.className = 'flip';
				//pullUpEl.querySelector('.pullUpLabel').innerHTML = '松手开始更新...';
				this.maxScrollY = this.maxScrollY;
			} else if (this.y > (this.maxScrollY + 5) && pullUpEl.className.match('flip')) {
				pullUpEl.className = '';
				//pullUpEl.querySelector('.pullUpLabel').innerHTML = '上拉加载更多...';
				this.maxScrollY = pullUpOffset;
			}
		},
		onScrollEnd: function () {
			if (pullDownEl.className.match('flip')) {
				pullDownEl.className = 'loadingUp';
				pullDownEl.querySelector('.pullDownLabel').innerHTML = '加载中UP...';				
				pullDownAction();	// Execute custom function (ajax call?)
			} else if (pullUpEl.className.match('flip')) {
				pullUpEl.className = 'loading';
				pullUpEl.querySelector('.pullUpLabel').innerHTML = '加载中...';				
				pullUpAction();	// Execute custom function (ajax call?)
			}
		}
	});
	
	setTimeout(function () { document.getElementById('wrapper').style.left = '0'; }, 800);
}

//初始化绑定iScroll控件 
document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
document.addEventListener('DOMContentLoaded', loaded, false); 

</script>
</html>